-- GENERATED SPELL FOR [Coilfang Beast-Tamer] --


function spell0_21221(pUnit, Event) --@Bestial Wrath,n/a--
pUnit:FullCastSpellOnTarget(38484,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_21221', 18317, 1)
end

function spell1_21221(pUnit, Event) --@Cleave,n/a--
pUnit:FullCastSpellOnTarget(38474,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_21221', 593, 1)
end

function spell2_21221(pUnit, Event) --@Throw,n/a--
pUnit:FullCastSpellOnTarget(38904,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_21221', 601, 1)
end

function Sorts_21221(pUnit, Event)
local choix_sorts_21221 = math.random(0, 2)
if choix_sorts_21221 == 0 then
pUnit:RegisterEvent('spell0_21221', 1, 1)
end
if choix_sorts_21221 == 1 then
pUnit:RegisterEvent('spell1_21221', 1, 1)
end
if choix_sorts_21221 == 2 then
pUnit:RegisterEvent('spell2_21221', 1, 1)
end
end

function mob21221_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_21221', math.random(1500, 3000), 1)
end

function mob21221_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob21221_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob21221_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(21221, 1, 'mob21221_Action')
RegisterUnitEvent(21221, 2, 'mob21221_Leave')
RegisterUnitEvent(21221, 3, 'mob21221_Kill')
RegisterUnitEvent(21221, 4, 'mob21221_Die')
